package lab_10.com.acme.bankapp.service.bank;

import java.util.ArrayList;

import lab_10.com.acme.bankapp.domain.bank.*;

public class BankApplication {

	public static void main(String[] args) {
		
		ArrayList<ClientRegistrationListener> listeners = new ArrayList<ClientRegistrationListener>();
		listeners.add(new Bank.EmailNotificationListener());
		listeners.add(new Bank.PrintClientListener());
		
		Bank bank = new Bank(listeners);

		System.out.println("Creating first client with savings account.");
		Client client1 = BankService.addClient(bank, new Client(Gender.FEMALE,
				"Lena", new SavingsAccount(10)));
		// Info will be printed through invocation of PrintClientListener

		System.out.println("Adding second checking account.");
		client1.addClientAccount(new CheckingAccount(15, 10));
		client1.printAllClientData();

		System.out.println("Putting 6 on the first account.");
		client1.printAllClientData();

		System.out.println("Withdrawing 20 from the first account.");
		client1.printAllClientData();

		System.out.println("Withdrawing 20 from the second account.");
		client1.printAllClientData();

		System.out.println("Withdrawing 7 from the second account.");
		client1.printAllClientData();

		System.out.println("Putting 10 on the second account.");
		client1.printAllClientData();

		System.out.println("Withdrawing 7 from the second account.");
		client1.printAllClientData();

		System.out.println("Creating second client with checking account.");
		@SuppressWarnings("unused")
		Client client2 = BankService.addClient(bank, new Client(Gender.MALE,
				"Oleg", new CheckingAccount(5, 5)));
		// Info will be printed through invocation of PrintClientListener

	}


}
